import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { FeedbackCooperationVO, FeedbackCooperationForm, FeedbackCooperationQuery } from '@/api/system/feedbackCooperation/types';

/**
 * 查询脚轮反馈与合作信息列表
 * @param query
 * @returns {*}
 */

export const listFeedbackCooperation = (query?: FeedbackCooperationQuery): AxiosPromise<FeedbackCooperationVO[]> => {
  return request({
    url: '/system/feedbackCooperation/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询脚轮反馈与合作信息详细
 * @param id
 */
export const getFeedbackCooperation = (id: string | number): AxiosPromise<FeedbackCooperationVO> => {
  return request({
    url: '/system/feedbackCooperation/' + id,
    method: 'get'
  });
};

/**
 * 新增脚轮反馈与合作信息
 * @param data
 */
export const addFeedbackCooperation = (data: FeedbackCooperationForm) => {
  return request({
    url: '/system/feedbackCooperation',
    method: 'post',
    data: data
  });
};

/**
 * 修改脚轮反馈与合作信息
 * @param data
 */
export const updateFeedbackCooperation = (data: FeedbackCooperationForm) => {
  return request({
    url: '/system/feedbackCooperation',
    method: 'put',
    data: data
  });
};

/**
 * 删除脚轮反馈与合作信息
 * @param id
 */
export const delFeedbackCooperation = (id: string | number | Array<string | number>) => {
  return request({
    url: '/system/feedbackCooperation/' + id,
    method: 'delete'
  });
};
